import createAxiosInstance from '@/axios/request';

const attendanceRecordsApi = createAxiosInstance('/api/attendance-records')

// 考勤记录相关API
export const attendanceApi = {
  // 获取考勤记录列表
  getAttendanceRecords: () => {
    return attendanceRecordsApi.get('/')
  },
  
  // 创建考勤记录
  createAttendanceRecord: (data: any) => {
    return attendanceRecordsApi.post('/', data)
  },
  
  // 批量创建考勤记录
  batchCreateAttendanceRecords: (data: any[]) => {
    return attendanceRecordsApi.post('/batch', data)
  },
  
  // 更新考勤记录
  updateAttendanceRecord: (id: number, data: any) => {
    return attendanceRecordsApi.put(`/${id}`, data)
  },
  
  // 删除考勤记录
  deleteAttendanceRecord: (id: number) => {
    return attendanceRecordsApi.delete(`/${id}`)
  }
}